Skip to content

Update UltraSwapService.ts#213

Open
Leon-Zh80 wants to merge 1 commit into
jup-ag:mainfrom
Leon-Zh80:patch-1
Open

Update UltraSwapService.ts#213
Leon-Zh80 wants to merge 1 commit into
jup-ag:mainfrom
Leon-Zh80:patch-1

Conversation

@Leon-Zh80

Copy link
Copy Markdown

No description provided.

@vercel

vercel Bot commented Nov 25, 2025

Copy link
Copy Markdown

@Leon-Zh80 is attempting to deploy a commit to the wowcats Team on Vercel.

A member of the Team first needs to authorize it.

@thejesh23 thejesh23 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is presented as a tidy-up but quietly introduces breaking changes that the empty description doesn't call out. Worth either splitting or documenting before merge:

  1. Dropped status: 'Success' | 'Failed' from UltraSwapResponseBase — any caller that switches on response.status to distinguish success/failure now silently breaks. If the discriminator is meant to come from elsewhere (e.g. presence of error), the union still works structurally but every existing consumer needs an audit.

  2. throw responsethrow new UltraSwapApiError(...) — this is a behavioral change at every call site. Existing catch blocks that expect a Response (and call .json() on it, or check .status) will fail. Better error handling is a real improvement, but it has to land with the call-site updates in the same PR, otherwise quotes/swaps will throw uncaught.

  3. _fetchAndCheck returns Promise<any> — erases the type safety that the original explicit response.json() calls were leaning on. Worth making it generic: private async _fetchAndCheck<T>(...): Promise<T>.

  4. Title "Update UltraSwapService.ts" + empty body for a 146/-83 line refactor across the service surface — please add a description so reviewers can assess intent vs. scope.

Most of the structural cleanup (UltraSwapApiError, route map rename, JSDoc) looks fine in isolation; the concern is bundling breaking interface changes alongside it without notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants